<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionAttribute 类</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="reflectionreference.getid.html">« ReflectionReference::getId</a></li>
      <li style="float: right;"><a href="reflectionattribute.construct.html">ReflectionAttribute::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.reflection.html">反射</a></li>
    <li>ReflectionAttribute 类</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.reflectionattribute" class="reference">

 <h1 class="title">ReflectionAttribute 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 8)</p>


  <div class="section" id="reflectionattribute.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <span class="classname"><strong class="classname">ReflectionAttribute</strong></span> 类提供有关
    <a href="language.attributes.html" class="link">属性</a> 的信息。
   </p>
  </div>


  <div class="section" id="reflectionattribute.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">ReflectionAttribute</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.reflector.html" class="interfacename">Reflector</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionattribute.html#reflectionattribute.constants.is-instanceof"><var class="varname">IS_INSTANCEOF</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">private</span> <span class="methodname"><a href="reflectionattribute.construct.html" class="methodname">__construct</a></span>()</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionattribute.getarguments.html" class="methodname">getArguments</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionattribute.getname.html" class="methodname">getName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionattribute.gettarget.html" class="methodname">getTarget</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionattribute.isrepeated.html" class="methodname">isRepeated</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionattribute.newinstance.html" class="methodname">newInstance</a></span>(): <span class="type">object</span></div>

   }</div>


  </div>

  
  <div class="section" id="reflectionattribute.constants">
   <h2 class="title">预定义常量</h2>
   <div class="section" id="reflectionattribute.constants.flags">
    <h2 class="title">ReflectionAttribute Flags</h2>
    <dl>

     
      <dt id="reflectionattribute.constants.is-instanceof"><strong><code>ReflectionAttribute::IS_INSTANCEOF</code></strong></dt>

      <dd>

       <p class="para">
        使用 <code class="parameter">instanceof</code> 检索属性。
       </p>
      </dd>

     

    </dl>

    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      这些常量的值可能会在不同 PHP 版本间发生更改。建议始终使用常量而不直接依赖值。
     </p>
    </p></blockquote>
   </div>
  </div>
  

 </div>

 
















































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionattribute.construct.html">ReflectionAttribute::__construct</a> — 禁止直接实例化的私有构造函数</li><li><a href="reflectionattribute.getarguments.html">ReflectionAttribute::getArguments</a> — 获取传递给属性的参数</li><li><a href="reflectionattribute.getname.html">ReflectionAttribute::getName</a> — 获取属性名称</li><li><a href="reflectionattribute.gettarget.html">ReflectionAttribute::getTarget</a> — 返回属性的目标位掩码</li><li><a href="reflectionattribute.isrepeated.html">ReflectionAttribute::isRepeated</a> — 返回该名称的属性是否已重复出现在代码元素上</li><li><a href="reflectionattribute.newinstance.html">ReflectionAttribute::newInstance</a> — 实例化由 ReflectionAttribute 类和参数表示的属性类</li></ul>
</div>
</div></div></body></html>